package com.example.jenkinsdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author QinJiaYing
 * @description
 * @date 2021/12/12 9:15
 */
@Controller
public class HelloController {

    @RequestMapping("/")
    public String welcome(){
        return "main";
    }

    @RequestMapping("/hello/{name}")
    public String hello(@PathVariable String name, Model model){
        System.out.println(name);
        String msg=name+"你好呀！";
        model.addAttribute("msg",msg);
        return "hello";
    }
}
